package com.millstein.tsinglog.commons.service;

import com.millstein.tsinglog.utils.ConcurrentDateUtils;

import java.util.Date;

public class BaseService {

    public String getCurrentDateStr() {
        Date date = new Date();
        return ConcurrentDateUtils.format(date);
    }

    /**
     * 延时time的时间创建dateStr
     * @param time 延时时间，单位毫秒
     * @return
     */
    public String getCurrentDateStr(long time) {
        Date date = new Date();
        date.setTime(date.getTime() + time);
        return ConcurrentDateUtils.format(date);
    }
}
